/*
 * Copyright 2009 SHOP.COM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.shop.opensocial.mediated.services;

import com.shop.opensocial.mediated.types.PersonMediator;
import com.shop.opensocial.mediated.types.UserIdMediator;
import com.shop.opensocial.mediated.types.GroupIdMediator;
import com.shop.opensocial.mediated.types.CollectionOptionsMediator;
import com.shop.opensocial.mediated.types.SecurityTokenMediator;
import com.shop.opensocial.mediated.request.MediatedRequest;
import java.util.List;
import java.util.Set;

/**
 * Independent mediator for OpenSocial Person Service
 *
 * @author Jordan Zimmerman
 */
public interface PersonServiceMediator
{
	/**
	 * Returns a list of people that correspond to the passed in person ids.
	 *
	 * @param request request data
	 * @param userIds A set of users
	 * @param groupId The group
	 * @param collectionOptions How to filter, sort and paginate the collection being fetched
	 * @param fields The profile details to fetch. Empty set implies all
	 * @param token The gadget token
	 * @return list of people
	 * @throws Exception errors
	 */
	public List<PersonMediator> getPeople(MediatedRequest request, Set<UserIdMediator> userIds, GroupIdMediator groupId, CollectionOptionsMediator collectionOptions, Set<String> fields, SecurityTokenMediator token) throws Exception;

	/**
	 * Returns a person that corresponds to the passed in person id.
	 *
	 * @param request request data
	 * @param id The id of the person to fetch.
	 * @param fields The fields to fetch.
	 * @param token The gadget token
	 * @return a list of people.
	 * @throws Exception errors
	 */
	public PersonMediator getPerson(MediatedRequest request, UserIdMediator id, Set<String> fields, SecurityTokenMediator token) throws Exception;
}
